#pragma once
#ifndef __MEMORYMENAGER_H
#define __MEMORYMENAGER_H
#include "List.h"
#include <iostream>
#include <fstream>
using namespace std;
const int UNUSEDBLOCK = -2;


class MemoryMenager
{
	fstream myfile;

public:
	char *filename;
	List FreeBlocks;
	int CurrentIndex;
	char CurrentAction[50];


	int Memory[1000];
	ListItem *Pointer[100];
	List pFreeList;

	typedef enum action {fa_alloc,fa_free} fileaction;
	typedef struct{
		int Index;
		int Size;
		fileaction action;
	}MemoryAction;

	MemoryMenager(char * FN);
	~MemoryMenager();

	MemoryAction getNextCommand();
	void Memory_Allocation(MemoryAction MA);
	void Memory_Free(MemoryAction MA);

	void Run();
    virtual void Draw()=0;

};

#endif